import mountNativeElement from './mountNativeElement';
import mountComponent from './mountComponent';
import { isFunction } from './utils';

/*
 * @author: yang long
 * @description: 挂载方法
 * @virtualDOM {type}: 虚拟dom
 * @container {type}: 要挂载的 html 节点
 */
export default function mountElement(virtualDOM, container, oldDOM) {
  if (isFunction(virtualDOM)) {
    // Component
    mountComponent(virtualDOM, container, oldDOM);
  } else {
    // NativeElement
    mountNativeElement(virtualDOM, container, oldDOM);
  }
}
